/*     */ package nccloud.web.ic.pub.action;
/*     */ 
/*     */ import java.util.HashMap;
/*     */ import java.util.Map;
/*     */ import nc.vo.ic.general.define.ICBillVO;
/*     */ import nc.vo.ml.NCLangRes4VoTransl;
/*     */ import nc.vo.scmpub.res.billtype.ICBillType;
/*     */ import nc.vo.scmpub.util.BillBodySortUtils;
/*     */ import nccloud.commons.lang.StringUtils;
/*     */ import nccloud.dto.ic.pub.entity.BillVOWithExtendInfo;
/*     */ import nccloud.dto.ic.pub.entity.QueryInfo;
/*     */ import nccloud.framework.core.json.IJson;
/*     */ import nccloud.framework.service.ServiceLocator;
/*     */ import nccloud.framework.web.action.itf.ICommonAction;
/*     */ import nccloud.framework.web.container.IRequest;
/*     */ import nccloud.framework.web.json.JsonFactory;
/*     */ import nccloud.framework.web.ui.model.row.Cell;
/*     */ import nccloud.framework.web.ui.model.row.Row;
/*     */ import nccloud.framework.web.ui.pattern.billcard.BillCard;
/*     */ import nccloud.pubitf.ic.pub.service.IICBillVOQueryService;
/*     */ import nccloud.web.ic.pub.precision.ICBaseBillcardPrecisionHandler;
/*     */ import nccloud.web.ic.pub.utils.DealDisplayIsNullUtil;
/*     */ import nccloud.web.ic.ui.pattern.billcard.ICBillCardOperator;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class QueryByPKAction
/*     */   implements ICommonAction
/*     */ {
/*     */   public Object doAction(IRequest request) {
/*  37 */     String str = request.read();
/*  38 */     IJson json = JsonFactory.create();
/*  39 */     QueryInfo info = (QueryInfo)json.fromJson(str, QueryInfo.class);
/*     */     
/*  41 */     BillVOWithExtendInfo extendinfo = ((IICBillVOQueryService)ServiceLocator.find(IICBillVOQueryService.class)).queryBillExt(getBilltype(), info.getPk());
/*     */ 
/*     */ 
/*     */     
/*  45 */     if (extendinfo == null || extendinfo.getBillvo() == null) {
/*  46 */       throw new RuntimeException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0180"));
/*     */     }
/*     */     
/*  49 */     BillBodySortUtils.sort(new ICBillVO[] { extendinfo.getBillvo() });
/*     */     
/*  51 */     BillCard retcard = afterProcess(info.getPagecodechi(), info.getPageid(), extendinfo
/*  52 */         .getBillvo());
/*  53 */     dealCarrier(retcard);
/*  54 */     Map<String, Object> retmap = new HashMap<String, Object>();
/*  55 */     retmap.put("billcard", retcard);
/*  56 */     retmap.put("isLocationManaged", Boolean.valueOf(extendinfo.isLocationManaged()));
/*  57 */     retmap.put("materialSerialMap", extendinfo.getMaterialSerialMap());
/*  58 */     retmap.put("materialSnunitMap", extendinfo.getMaterialSnunitMap());
/*     */ 
/*     */     
/*  61 */     return retmap;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*  70 */   protected ICBillType getBilltype() { throw new RuntimeException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0198")); }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public BillCard afterProcess(String pagecodechi, String pageid, ICBillVO vo) {
/*  85 */     ICBillCardOperator operator = new ICBillCardOperator(null, pageid, pagecodechi);
/*  86 */     BillCard retcard = operator.toCard(vo);
/*     */     
/*  88 */     String ccurrencyid = (String)vo.getBody(0).getAttributeValue("ccurrencyid");
/*  89 */     if (!StringUtils.isEmpty(ccurrencyid) && vo instanceof nc.vo.ic.m4455.entity.SapplyBillVO) {
/*  90 */       retcard.getBody().getModel().getListRows().stream().forEach(row -> {
/*  91 */             Cell cell = new Cell();
/*  92 */             cell.setValue(ccurrencyid);
/*  93 */             cell.setDisplay(ccurrencyid);
/*  94 */             row.addCell("ccurrencyid", cell);
/*     */           });
/*     */     }
/*     */ 
/*     */ 
/*     */     
/* 100 */     ICBaseBillcardPrecisionHandler handler = getPrecisionHandler(retcard);
/* 101 */     handler.process();
/*     */     
/* 103 */     DealDisplayIsNullUtil.dealBillCardDisPlayIsNull(new String[] { "ccorrespondcode", "vexigencycode" }, retcard);
/*     */     
/* 105 */     return retcard;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/* 116 */   protected ICBaseBillcardPrecisionHandler getPrecisionHandler(BillCard card) { return new ICBaseBillcardPrecisionHandler(card); }
/*     */   
/*     */   protected void dealCarrier(BillCard card) {}
/*     */ }


/* Location:              E:\zhuhai_ncc\NCC2111\external\li\\uiic_nccloud.jar!/nccloud/web/ic/pub/action/QueryByPKAction.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.0.7
 */